//package chapter15.h15_2;
//
//import java.io.FileWriter;
//import java.util.Enumeration;
//import java.util.Properties;
//
//public class PageMaker {
//    private PageMaker(){
//        //不允许生成PageMaker的实例，因此构造函数设为private
//    }
//
//    public static void makeWelcomePage(String mailaddr, String filename){
//        try{
//            Properties mailprop = DataBase.getProperties("maildata");
//            String username = mailprop.getProperty(mailaddr);
//            HtmlMaker writer = new HtmlMaker(new FileWriter(filename));
//            writer.title("Welcome to " + username + "'s page!");
//            writer.paragraph("欢迎来到 " + username + " 的主页。");
//            writer.paragraph("等着你的邮件哟！");
//            writer.mailto(mailaddr, username);
//            writer.close();
//            System.out.println(filename + " is created for " + mailaddr + username + ")");
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//    }
//
//    public static void makeLinkPage(String filename){
//        try{
//            HtmlMaker writer = new HtmlWriter(new FileWriter(filename));
//            writer.title("Link Page");
//            Properties mailprop = DataBase.getProperties("maildata");
//            Enumeration en = mailprop.propertyNames();
//            while (en.hasMoreElements()){
//                String mailaddr = (String)en.nextElement();
//                String username = mailprop.getProperty(mailaddr, "(unknown)");
//                writer.mailto(mailaddr, username);
//            }
//            writer.close();
//            System.out.println(filename + " is created.");
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//    }
//
//
//}
